﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Pos.DAL;
using Pos.Model;
using Pos.SharedLibrary;

namespace POS
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_signin_click(object sender, EventArgs e)
        {
            string Username = tb_Username.Text;
            string Password = tb_Password.Text;

            EmployeeDAL employee = new EmployeeDAL();
            Boolean result = employee.CheckLogin(Username, Password);
            if (!result)
            {
                //Response.Write("<script type='text/javascript'>alert('123');window.location.reload();</script>");
                ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script>MyFun();</script>");
            }
            else
            {
                Response.Redirect("index.aspx",true);
            }
        }

    }
}